home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ruthie / ruthie.frm < prev    next >
Text File  |  1995-05-08  |  7KB  |  254 lines

  1. VERSION 2.00
  2. Begin Form Ruthie 
  3.    Caption         =   "RuthieWare"
  4.    ClientHeight    =   3840
  5.    ClientLeft      =   4020
  6.    ClientTop       =   750
  7.    ClientWidth     =   9090
  8.    Height          =   4530
  9.    Icon            =   RUTHIE.FRX:0000
  10.    Left            =   3960
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form2"
  13.    ScaleHeight     =   3840
  14.    ScaleWidth      =   9090
  15.    Top             =   120
  16.    Width           =   9210
  17.    Begin PictureBox Actions 
  18.       AutoRedraw      =   -1  'True
  19.       BorderStyle     =   0  'None
  20.       Height          =   615
  21.       Left            =   8400
  22.       ScaleHeight     =   615
  23.       ScaleWidth      =   1335
  24.       TabIndex        =   3
  25.       Top             =   7080
  26.       Width           =   1335
  27.       Begin PictureBox GoToGame2 
  28.          AutoRedraw      =   -1  'True
  29.          BorderStyle     =   0  'None
  30.          Height          =   495
  31.          Left            =   720
  32.          Picture         =   RUTHIE.FRX:0302
  33.          ScaleHeight     =   495
  34.          ScaleWidth      =   495
  35.          TabIndex        =   5
  36.          Top             =   120
  37.          Width           =   495
  38.       End
  39.       Begin PictureBox Quit 
  40.          AutoRedraw      =   -1  'True
  41.          BorderStyle     =   0  'None
  42.          Height          =   495
  43.          Left            =   0
  44.          Picture         =   RUTHIE.FRX:0604
  45.          ScaleHeight     =   495
  46.          ScaleWidth      =   495
  47.          TabIndex        =   4
  48.          Top             =   120
  49.          Width           =   495
  50.       End
  51.    End
  52.    Begin Timer Timer2 
  53.       Left            =   1320
  54.       Top             =   6960
  55.    End
  56.    Begin Timer Timer1 
  57.       Left            =   720
  58.       Top             =   6960
  59.    End
  60.    Begin PictureBox Background 
  61.       BorderStyle     =   0  'None
  62.       Height          =   2655
  63.       Left            =   9720
  64.       Picture         =   RUTHIE.FRX:0906
  65.       ScaleHeight     =   2655
  66.       ScaleWidth      =   3495
  67.       TabIndex        =   6
  68.       Top             =   360
  69.       Visible         =   0   'False
  70.       Width           =   3495
  71.    End
  72.    Begin PictureBox LiveArea 
  73.       BorderStyle     =   0  'None
  74.       Height          =   6735
  75.       Left            =   360
  76.       ScaleHeight     =   6735
  77.       ScaleWidth      =   9255
  78.       TabIndex        =   0
  79.       Top             =   240
  80.       Width           =   9255
  81.       Begin PictureBox SadFace 
  82.          BorderStyle     =   0  'None
  83.          Height          =   3615
  84.          Left            =   2040
  85.          Picture         =   RUTHIE.FRX:27CE
  86.          ScaleHeight     =   3615
  87.          ScaleWidth      =   3735
  88.          TabIndex        =   2
  89.          Top             =   1440
  90.          Visible         =   0   'False
  91.          Width           =   3735
  92.       End
  93.       Begin PictureBox Picture1 
  94.          BackColor       =   &H000000FF&
  95.          Height          =   1575
  96.          Left            =   1680
  97.          ScaleHeight     =   1545
  98.          ScaleWidth      =   1545
  99.          TabIndex        =   1
  100.          Top             =   720
  101.          Width           =   1575
  102.       End
  103.    End
  104.    Begin Menu File 
  105.       Caption         =   "&File"
  106.       Begin Menu FileAbout 
  107.          Caption         =   "&About Ruthie"
  108.       End
  109.       Begin Menu FileExit 
  110.          Caption         =   "E&xit"
  111.       End
  112.    End
  113.    Begin Menu Game 
  114.       Caption         =   "&Game"
  115.       Begin Menu GameGame1 
  116.          Caption         =   "Game &1"
  117.          Checked         =   -1  'True
  118.       End
  119.       Begin Menu GameGame2 
  120.          Caption         =   "Game &2"
  121.       End
  122.       Begin Menu GameGame3 
  123.          Caption         =   "Game &3"
  124.       End
  125.    End
  126.    Begin Menu Instructions 
  127.       Caption         =   "&Instructions"
  128.       Begin Menu InstructionsGame1 
  129.          Caption         =   "Playing Game &1"
  130.       End
  131.    End
  132. End
  133.  
  134.  
  135. Sub FileAbout_Click ()
  136.     Open2.Show 1
  137. End Sub
  138.  
  139. Sub FileExit_Click ()
  140.     End
  141. End Sub
  142.  
  143. Sub Form_Click ()
  144.     SadFace.ScaleWidth = Ruthie.ScaleWidth / 2.5
  145.     SadFace.ScaleHeight = SadFace.ScaleWidth
  146.     SadFace.Left = (Ruthie.ScaleWidth - SadFace.ScaleWidth) / 2  ' Position SadFace, but don't resize it
  147.     SadFace.Top = (Ruthie.ScaleHeight - SadFace.ScaleHeight) / 2
  148.    
  149.     SadFace.Visible = True
  150.     Timer2.Interval = HowLong
  151. End Sub
  152.  
  153. Sub Form_Load ()
  154.     Ruthie.Width = Screen.Width * .75           ' Set height of form.
  155.     Ruthie.Height = Screen.Height * .75         ' Set width of form.
  156.     Ruthie.Left = (Screen.Width - Width) / 2    ' Center form horizontally.
  157.     Ruthie.Top = (Screen.Height - Height) / 2   ' Center form vertically.
  158.  
  159.     Initialize                                  ' Define shapes, sizes, placements
  160. End Sub
  161.  
  162. Sub Form_Resize ()
  163.     Scale                                   ' Reset scale to twips
  164.     If Ruthie.Height > 100 Then Initialize  ' If the Height is smaller, than it's been
  165.                         ' minimized. We don't want to initialize if
  166.                         ' that's the case.
  167. End Sub
  168.  
  169. Sub GameGame1_Click ()
  170.      MsgBox "Umm... You're already playing Game 1", 0, Header
  171. End Sub
  172.  
  173. Sub GameGame2_Click ()
  174.     Ruthie.Hide
  175.     Game2.Show
  176. End Sub
  177.  
  178. Sub GameGame3_Click ()
  179.     Ruthie.Hide
  180.     Game3.Show
  181. End Sub
  182.  
  183. Sub GoToGame2_Click ()
  184.     Ruthie.Hide
  185.     Game2.Show
  186. End Sub
  187.  
  188. Sub Initialize ()
  189.     Ruthie.Scale (0, 0)-(100, 75)               ' Define the scale for the form
  190.     LiveArea.Scale (0, 0)-(100, 75)             ' Define the live area scale
  191.     
  192.     LiveArea.Width = Ruthie.ScaleWidth          ' Place LiveArea
  193.     LiveArea.Height = Ruthie.ScaleHeight * .7
  194.     LiveArea.Left = (Ruthie.ScaleWidth - LiveArea.Width) / 2
  195.     LiveArea.Top = 5
  196.     
  197.     Background.Width = Ruthie.ScaleWidth * .8   ' Place Background
  198.     Background.Height = Ruthie.ScaleHeight * .8
  199.     Background.Left = (Ruthie.ScaleWidth - LiveArea.Width) / 2
  200.     Background.Top = (Ruthie.ScaleHeight - LiveArea.Height) / 2
  201.  
  202.     Picture1.Left = 25
  203.     Picture1.Top = 25
  204.     
  205.     Actions.Left = 80                           ' Place the action icons (Stop, Game2, etc.)
  206.     Actions.Top = 68
  207.  
  208.     Actions.Refresh
  209.     Quit.Refresh
  210.     GoToGame2.Refresh
  211.  
  212.     Randomize                                   ' Reseed the random number generator
  213.     
  214. End Sub
  215.  
  216. Sub InstructionsGame1_Click ()
  217.     InstGame1.Show MODAL
  218. End Sub
  219.  
  220. Sub LiveArea_Click ()
  221.     Form_Click
  222. End Sub
  223.  
  224. Sub Picture1_Click ()
  225.     Dim WidthFree As Integer, HeightFree As Integer
  226.     Background.Visible = True
  227.  
  228. '   *** We've beeped, and turned on the picture. Now we
  229. '       want to move the button before we launch the timer.
  230.     WidthFree = LiveArea.ScaleWidth - Picture1.Width
  231.     HeightFree = LiveArea.ScaleHeight - Picture1.Height
  232.     Picture1.Move (Int(WidthFree * Rnd)), (Int(HeightFree * Rnd))
  233.     
  234. '   *** Now, if that worked, we'll set the timer. When it's done,
  235. '       it will turn the background picture off, and we'll start
  236. '       again.
  237.  
  238.     Timer1.Interval = HowLong
  239. End Sub
  240.  
  241. Sub Quit_Click ()
  242.     End
  243. End Sub
  244.  
  245. Sub Timer1_Timer ()
  246.     Background.Visible = False
  247.     Picture1.Refresh
  248. End Sub
  249.  
  250. Sub Timer2_Timer ()
  251.     SadFace.Visible = False
  252. End Sub
  253.  
  254.